//
//  UIColor+CD.m
//  CollectToDesktop
//
//  Created by 王启颖 on 2020/10/15.
//  Copyright © 2020 godbe. All rights reserved.
//

#import "UIColor+CD.h"

@implementation UIColor (CD)
+ (instancetype)jg_colorHex:(uint32_t)hex {
    return [self jg_colorHex:hex alpha:1.0];
}

+ (instancetype)jg_colorHex:(uint32_t)hex alpha:(CGFloat)alpha {
    u_int8_t red = (0xFF0000 & hex) >> 16;
    u_int8_t green = (0x00FF00 & hex) >> 8;
    u_int8_t blue = (0x0000FF & hex);
    
    return [UIColor colorWithRed:red / 255.0 green:green / 255.0 blue:blue / 255.0 alpha:alpha];
}

@end
